package com.jeeplus.mob.web;

import com.jeeplus.common.json.AjaxJson;
import com.jeeplus.mob.service.CardrecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping(value = "/mob/cardrecord")
@Api(tags = "打卡记录信息")
public class CardrecordController {

    @Autowired
    private CardrecordService cardrecordService;

//    /**
//     * 打卡：punchType:(1:在途打卡，2：楼宇打卡)
//     * @return
//     */
//    @RequestMapping(value = "punch",method = RequestMethod.POST)
//    @ApiOperation("打卡")
//    public AjaxJson punch(@RequestParam(value = "cardrecordInfo")CardrecordInfo cardrecordInfo) {
//        AjaxJson ajaxJson = cardrecordService.punch(cardrecordInfo);
//        return ajaxJson;
//    }
//
//    /**
//     * 在途打卡
//     * @param cardrecordInfo
//     * @return
//     */
//    @RequestMapping(value = "punchWay",method = RequestMethod.POST)
//    @ApiOperation(value = "在途打卡")
//    public AjaxJson punchWay(@RequestParam(value = "cardrecordInfo") CardrecordInfo cardrecordInfo) {
//        AjaxJson ajaxJson = cardrecordService.punchWay(cardrecordInfo);
//        return ajaxJson;
//    }
//
//    /**
//     * 楼宇打卡
//     * @param cardrecordInfo
//     * @return
//     */
//    @RequestMapping(value = "punchBuilding",method = RequestMethod.POST)
//    @ApiOperation(value = "楼宇打卡")
//    public AjaxJson punchBuilding(@RequestParam(value = "cardrecordInfo")CardrecordInfo cardrecordInfo) {
//        AjaxJson ajaxJson = cardrecordService.punchBuilding(cardrecordInfo);
//        return ajaxJson;
//    }

    /**
     * 根据用户打卡日期获取打卡数据统计
     * @param request
     * @param response
     * @return
     */
    /*@RequestMapping(value = "getPunchDataStatistics",method = RequestMethod.GET)
    @ApiOperation(value = "获取打卡数据统计")
    public AjaxJson getPunchDataStatistics(HttpServletRequest request,HttpServletResponse response) {
        AjaxJson ajaxJson = cardrecordService.getPunchDataStatistics(request,response);
        return ajaxJson;
    }*/

    /**
     * 根据用户打卡日期获取打卡数据统计
     * @param request
     * @param response
     * @return
     */
    /*@RequestMapping(value = "getPunchDataStatistics",method = RequestMethod.GET)
    @ApiOperation(value = "获取打卡数据统计")
    public AjaxJson getPunchDataStatistics(HttpServletRequest request,HttpServletResponse response) {
        AjaxJson ajaxJson = cardrecordService.getPunchDataStatistics(request,response);
        return ajaxJson;
    }*/

    /**
     * 根据用户打卡日期获取打卡数据统计
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "getPunchDataStatistics",method = RequestMethod.GET)
    @ApiOperation(value = "获取打卡数据统计")
    public AjaxJson getPunchDataStatistics(HttpServletRequest request,HttpServletResponse response) {
        AjaxJson ajaxJson = cardrecordService.getPunchDataStatistics(request,response);
        return ajaxJson;
    }
}
